package com.charge.service.impl;

import com.charge.dao.UserSecurityMapping;
import com.charge.domain.UserSecurity;
import com.charge.service.UserSecurityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Description :
 * Author : 91658
 * Date : 2018/6/14 10:39
 **/
@Service
public class UserSecurityServiceImpl implements UserSecurityService {

    @Autowired
    private UserSecurityMapping userSecurityMapping;

    @Override
    @Transactional
    public void insertUserSecurity() {
        UserSecurity userSecurity = new UserSecurity();
        userSecurity.setId(1);
        userSecurityMapping.insertSelective(userSecurity);
        if (1 == 1) {
            throw new RuntimeException("test exception");
        }
        UserSecurity userSecurity1 = new UserSecurity();
        userSecurity1.setId(2);
        userSecurityMapping.insertSelective(userSecurity1);
    }
}
